package com.xingongchang.baolebei.protocol;

import org.json.JSONException;
import org.json.JSONObject;

import com.external.activeandroid.Model;
import com.external.activeandroid.annotation.Column;
import com.external.activeandroid.annotation.Table;


@Table(name = "AD")
public class AD extends Model {

	@Column(name = "topicid")
	public int topicid;

	@Column(name = "imgUrl")
	public String imgUrl;


	public static AD fromJson(JSONObject jsonObject) throws JSONException {
		if (null == jsonObject) {
			return null;
		}

		AD localItem = new AD();
		
		localItem.imgUrl = jsonObject.optString("imgUrl");
		localItem.topicid = jsonObject.optInt("topicid");

		return localItem;
	}

}